package com.portal.framework.dao;

import java.io.Serializable;

import org.hibernate.EmptyInterceptor;
import org.hibernate.type.Type;

public class UpdateInterceptor extends EmptyInterceptor {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8807707661913403398L;
	
	@Override
	public boolean onFlushDirty(Object entity, Serializable id,
			Object[] currentState, Object[] previousState,
			String[] propertyNames, Type[] types) {
		System.out.println(entity);
		System.out.println(id);
		System.out.println(currentState);
		System.out.println(previousState);
		System.out.println(propertyNames);
		System.out.println(types);
		return super.onFlushDirty(entity, id, currentState, previousState,
				propertyNames, types);
	}
	
	@Override
	public int[] findDirty(Object entity, Serializable id,
			Object[] currentState, Object[] previousState,
			String[] propertyNames, Type[] types) {
		System.out.println(entity);
		System.out.println(id);
		System.out.println(currentState);
		System.out.println(previousState);
		System.out.println(propertyNames);
		System.out.println(types);
		
		int[] findDirty = super.findDirty(entity, id, currentState, previousState, propertyNames,
				types);
		System.out.println(findDirty);
		return findDirty;
	}
}
